#pragma once

#include "cstd_lib.h"
#include <Arduino.h>
#include <Wire.h>
#include "SimulationPCAL6416A.h"

#ifdef __cplusplus
__always_inline void app_main_setup()
{
    // pinMode(PF2, INPUT);

    SimulationPCAL6416A::instance_uptr = std::make_unique<SimulationPCAL6416A>();

    std::array<uint8_t, 16> io_map = {
        PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7,
        PB0, PB1, PA13, PA14, PB3, PB5, PB6, PF4};

    // bool gpio_level = digitalRead(PF2) == HIGH;
    // SimulationPCAL6416A::instance_uptr->Init(gpio_level, io_map, &Wire);
    SimulationPCAL6416A::instance_uptr->Init(0, io_map, &Wire);
}

__always_inline void app_main_loop()
{
    // delay(1000);
}
#endif
